package com.auxgroup.hr.front.dao.repository;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.auxgroup.hr.front.dao.domain.PsCEvaDocOVw;
import com.auxgroup.hr.front.dao.domain.PsCEvaDocOVwPrimary;

/**
 * @author lv-PC
 *
 */
@Repository
public interface PsCEvaDocOVwRepository extends
JpaRepository<PsCEvaDocOVw,PsCEvaDocOVwPrimary>,JpaSpecificationExecutor<PsCEvaDocOVw> {
	
	@Query("select distinct d.cEvaSheetId,d.descr from PsCEvaDocOVw d where d.emplid=:emplid and d.emplRcd=0 and d.cEvaluateType=:evaType order by d.cEvaSheetId desc")
	public List<Object[]> getEvaDocsByEmplidAndEvaType(@Param("emplid") String emplid,@Param("evaType") String evaType);

	
	@Query("select distinct d.cEvaSheetId,d.descr from PsCEvaDocOVw d where d.emplid=:emplid and d.emplRcd=0 and d.cEvaluateType=:evaType and d.descr like :queryKey order by d.cEvaSheetId desc")
	public List<Object[]> getEvaDocsByEmplidAndEvaTypeAndDescr(@Param("emplid") String emplid,@Param("evaType") String evaType,@Param("queryKey") String queryKey);

}